package com.szcinda.repository;

public class CalculateTypeUtil {
    public static CalculateType getCalculateType(String name){
        switch (name){
            case "数量":
            case "QUANTITY":
                return CalculateType.QUANTITY;
            case "固定值":
            case "FIXED":
                return CalculateType.FIXED;
            case "体积":
            case "VOLUME":
                return CalculateType.VOLUME;
            case "重量":
            case "WEIGHT":
                return CalculateType.WEIGHT;
            default:
                return null;
        }
    }
    public static String getCalculateTypeString(CalculateType type){
        switch (type){
            case FIXED:
                return "固定值";
            case QUANTITY:
                return "数量";
            case VOLUME:
                return "体积";
            case WEIGHT:
                return "重量";
            default:
                return "";
        }
    }
}
